<template>
    <div class="order-box" v-for="item in list" :key="item">
        <div class="order-content" @click="goRoutePage(item.orderType,item.orderStatus)">
            <div class="o-c-tag">
                <!-- <uni-tag v-if="item.orderStatus  == 1" size="small" text="待提货" type="primary"  /> -->
                <uni-tag v-if="item.orderStatus  == 1" size="small" text="待使用" type="success"  />
                <uni-tag v-if="item.orderStatus  == 2" style="color: #ffffff;" size="small" text="已完成"   />
                <text class="o-c-title">{{item.title}}</text>
            </div>

            <text class="o-c-text">消耗权益分：{{item.money}}</text>
            <text class="o-c-text">{{item.introduce}}</text>
        </div>
        <div class="order-state">
            <button  @click="goOrderDetails(item)" v-if="item.orderStatus!==2" style="font-size: 23rpx;color: #00B588;border-color: #00B588;" type="primary" plain="true">出示二维码</button>
		</div>
    </div>
</template>

<script setup>
import { ref, defineEmits,inject} from "vue";

const emit = defineEmits(['handleCodeBtn'])
const dict = inject('dict');
const props = defineProps({
    list: {
      type: Array,
      default:()=> [{
        id: null,
        title:null,
        orderStatus:null,//订单状态
        orderType:null,//订单类型
        money:null,//金额
        total:null,//总计单数
        introduce:null,//介绍信息

      }]
    }
})

const goRoutePage=(params,orderStatus)=>{
    let hashMap = {
        0:'order-details-hotel',
        1:'order-details-attractions',
        2:'order-details-mall',
        3:'order-details-travel'
    }

}
const goOrderDetails = (item)=>{
    emit('handleCodeBtn', item)
	// uni.navigateTo({
	// 	url:'/pages/user/orderDetails'
	// })
}
const goSalesPage=()=>{

}
</script>

<style lang="less" scoped>
@import url(../less/orderBox.less);
</style>
